package topic

import (
	"gitcode.com/G-YT/ANN/server/api/v1"
	"gitcode.com/G-YT/ANN/server/middleware"
	"github.com/gin-gonic/gin"
)

type TopicRouter struct {
}

// InitTopicRouter 初始化 Topic 路由信息
func (s *TopicRouter) InitTopicRouter(Router *gin.RouterGroup) {
	toPicRouter := Router.Group("toPic").Use(middleware.OperationRecord())
	toPicRouterWithoutRecord := Router.Group("toPic")
	var toPicApi = v1.ApiGroupApp.TopicApiGroup.TopicApi
	{
		toPicRouter.POST("createTopic", toPicApi.CreateTopic)             // 新建Topic
		toPicRouter.DELETE("deleteTopic", toPicApi.DeleteTopic)           // 删除Topic
		toPicRouter.DELETE("deleteTopicByIds", toPicApi.DeleteTopicByIds) // 批量删除Topic
		toPicRouter.PUT("updateTopic", toPicApi.UpdateTopic)              // 更新Topic
	}
	{
		toPicRouterWithoutRecord.GET("findTopic", toPicApi.FindTopic)       // 根据ID获取Topic
		toPicRouterWithoutRecord.GET("getTopicList", toPicApi.GetTopicList) // 获取Topic列表
	}
}
